package com.juc.future;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;

/**
 * @Author Zan
 * @Create 2024/5/6 21:20
 * @ClassName : CompletableFutureMallDemo
 * @Description : TODO 请用一句话描述该类的功能
 */
public class CompletableFutureMallDemo {
    public static void main(String[] args) {

        CompletableFuture<String> completableFuture = CompletableFuture.supplyAsync(() -> {
            return "hello 12345";
        });

        // System.out.println(completableFuture.get());
        System.out.println(completableFuture.join());


//        Student student = new Student();
//
//        student.setId(1);
//        student.setStudentName("z3");
//        student.setMajor("cs");
//
//        student.setId(12).setStudentName("li4").setMajor("english");
    }
}

@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
class Student {
    private Integer id;

    private String studentName;

    private String major;
}
